@extends('base.base')
@section('base')
    <!-- 内容区域 -->
    <div class="main-panel">
        <div class="content-wrapper">
            <div class="row">
                <div class="col-12 grid-margin stretch-card">
                    <div class="card">
                        <div class="card-body">
                            <h4 class="card-title">请填写商品信息</h4>
                            <form class="forms-sample" id="form">
                                <input type="hidden"  class="form-control required" name="id" value="{{$order->id}}">
                                <div class="form-group">
                                    <label >* 产品名称</label>
                                    <input type="text"  class="form-control required" name="order_id" placeholder="配置描述" value="{{$order->order_id}}" disabled =“disabled”>
                                </div>
                                <input type="hidden"  class="form-control required" name="order_id" value="{{$order->order_id}}">
                                <div class="form-group">
                                    <label >* 商品总价</label>
                                    <input type="number"  class="form-control required" name="total_price" value="{{$order->total_price}}">
                                </div>
                                <div class="form-group">
                                    <label >* 原始邮费</label>
                                    <input type="number"  class="form-control required" name="total_postage" value="{{$order->total_postage}}">
                                </div>
                                <div class="form-group">
                                    <label >* 实际支付金额</label>
                                    <input type="number"  class="form-control required" name="pay_price" value="{{$order->pay_price}}">
                                </div>
                                <div class="form-group">
                                    <label >* 实际支付邮费</label>
                                    <input type="number"  class="form-control required" name="pay_postage" value="{{$order->pay_postage}}">
                                </div>
                                <div class="form-group">
                                    <label >* 赠送积分</label>
                                    <input type="number"  class="form-control required" name="gain_integral" value="{{$order->gain_integral}}">
                                </div>
                                <button type="button" onclick="commit()" class="btn btn-sm btn-gradient-primary btn-icon-text">
                                    <i class="mdi mdi-file-check btn-icon-prepend"></i>
                                    提交
                                </button>
                                <button type="button" onclick="cancel()" class="btn btn-sm btn-gradient-warning btn-icon-text">
                                    <i class="mdi mdi-reload btn-icon-prepend"></i>
                                    取消
                                </button>
                            </form>
                        </div>
                    </div>
                </div>
            </div>
        </div>
    </div>
    <script>
        function commit(){
            if(!checkForm()){
                return false;
            }
            var data = $("#form").serializeObject();
            myRequest("/admin/order/edit","post",data,function(res){
                layer.msg(res.msg)
                /*setTimeout(function(){
                    parent.location.reload();
                },1500)*/
            });
        }
        function cancel() {
            parent.location.reload();
        }
    </script>
@endsection
